local ENABLE_MAIL_MOD;
local ENABLE_RIGHT_CLICK;
local CT_MAIL_MOD_TITLE;



if (GetLocale() == "zhCN") then
	BIGFOOTGADGET_TITLE = {"便捷功能", "bianjiegongneng"};
	BIGFOOTGADGET_ENABLE_GPS = "开启坐标指示";
	BIGFOOTGADGET_ENABLE_MBB = "开启小地图按键包";	
	BIGFOOTGADGET_CHANGE_FONT = "修改系统字体";	
	BIGFOOTGADGET_CASTING_BAR = "使用大脚施法条"
	ENABLE_MAIL_MOD = "启用邮件助手";
	MOD_ARENA_TOOLKIT_ENABLE_FAST_FOCUS_TITLE = "开启快速设置焦点的功能";
	MOD_ARENA_TOOLKIT_ENABLE_FAST_FOCUS_TOOLTIP = "开启后，你可以通过按住Shift键点击目标头像来设置焦点目标";

	SCREEN_MARK_PHOTO_MODE="按住Shift键来截取纯画面"
	SCREEN_MARK_CINEMATIC_MODE="按住Alt键来截取电影模式画面"

	
elseif (GetLocale() == "zhTW") then
	BIGFOOTGADGET_TITLE = {"便捷功能", "bianjiegongneng"};
	BIGFOOTGADGET_ENABLE_GPS = "開啟座標指示";
	BIGFOOTGADGET_ENABLE_MBB = "開啟小地圖按鍵包";	
	BIGFOOTGADGET_CHANGE_FONT = "修改系統字體";	
	BIGFOOTGADGET_CASTING_BAR = "使用大腳施法條"
	ENABLE_MAIL_MOD = "啟用郵件助手";
	MOD_ARENA_TOOLKIT_ENABLE_FAST_FOCUS_TITLE = "開啟快速設置焦點的功能";
	MOD_ARENA_TOOLKIT_ENABLE_FAST_FOCUS_TOOLTIP = "開啟後，你可以通過按住Shift鍵點擊目標頭像來設置焦點目標";
	SCREEN_MARK_CINEMATIC_MODE="按住Alt鍵來截取電影模式畫面"
	SCREEN_MARK_PHOTO_MODE="按住Shift鍵來截取純畫面"

else
	BIGFOOTGADGET_TITLE = "BigFoot Gadget";
	BIGFOOTGADGET_ENABLE_GPS = "Enable GPS";
	BIGFOOTGADGET_ENABLE_MBB = "Enable Minimap button bag";	
	BIGFOOTGADGET_CHANGE_FONT = "Change Default font";	
	BIGFOOTGADGET_CASTING_BAR = "Use BFCastingBar"
	ENABLE_MAIL_MOD = "Enable CT-Mail Mod";
	MOD_ARENA_TOOLKIT_ENABLE_FAST_FOCUS_TITLE = "Enable Fast Focus";
	MOD_ARENA_TOOLKIT_ENABLE_FAST_FOCUS_TOOLTIP = "After you enable it, you can click target from by hold shift key to set focus frame.";

	SCREEN_MARK_CINEMATIC_MODE="Hold Alt key to taking cinematic screenshot"
	SCREEN_MARK_PHOTO_MODE="Hold shift key to taking pure screenshot"

end

ModManagement_RegisterMod(
	"BigFootGadget",
	"Interface\\Icons\\INV_Gizmo_HardenedAdamantiteTube",
	BIGFOOTGADGET_TITLE,
	"",
	nil,
	nil,
	{[7]=true}
);

if (IsConfigurableAddOn("BigFootGadget")) then
	ModManagement_RegisterCheckBox(
		"BigFootGadget",
		BIGFOOTGADGET_ENABLE_GPS,
		nil,
		"EnableBigFootGPS",
		1,
		function (arg)
			if (arg == 1) then
				if (not BigFoot_IsAddOnLoaded("BigFootGadget")) then
					BigFoot_LoadAddOn("BigFootGadget");
				end

				if (BigFoot_IsAddOnLoaded("BigFootGadget")) then
					BigFootGPS_Toggle(true);
				end
			else
				if (BigFoot_IsAddOnLoaded("BigFootGadget")) then
					BigFootGPS_Toggle(false);
				end
			end
		end
	);
end

if (IsConfigurableAddOn("MBB")) then
	ModManagement_RegisterCheckBox(
		"BigFootGadget",
		BIGFOOTGADGET_ENABLE_MBB,
		nil,
		"EnableBigFootMBB",
		1,
		function (arg)
			if (arg == 1) then
				if (not BigFoot_IsAddOnLoaded("MBB")) then
					BigFoot_LoadAddOn("MBB");
				end

				if (BigFoot_IsAddOnLoaded("MBB")) then
					MBB_Toggle(true);
				end
			else
				if (BigFoot_IsAddOnLoaded("MBB")) then
					MBB_Toggle(false);
				end
			end
		end
	);
end

ModManagement_RegisterCheckBox(
	"BigFootGadget",
	BIGFOOTGADGET_CHANGE_FONT,
	nil,
	"ChangeBigFootFont",
	1,
	function (arg)
		if (arg == 1) then
			BFGadget_FontName, BFGadget_FontHeight, BFGadget_FontFlags=NumberFontNormal:GetFont()
			NumberFontNormal:SetFont("Fonts\\ZYKai_T.TTF",14,"OUTLINE")
			__BFG_Font_Modified=true
		else
			if __BFG_Font_Modified then
				NumberFontNormal:SetFont(BFGadget_FontName or "Fonts\\ZYKai_C.ttf",BFGadget_FontHeight or 12,BFGadget_FontFlags or "OUTLINE")
			end
			__BFG_Font_Modified=false
		end
	end
);

ModManagement_RegisterCheckBox(
	"BigFootGadget",
	BIGFOOTGADGET_CASTING_BAR,
	nil,
	"BFCB",
	1,
	function (arg)
		if (arg == 1) then
			if (not BigFoot_IsAddOnLoaded("BFCastingBar")) then
				BigFoot_LoadAddOn("BFCastingBar");
			end
			if (BigFoot_IsAddOnLoaded("BFCastingBar")) then
				BFCB:Toggle(true)
			end	
		else
			if (BigFoot_IsAddOnLoaded("BFCastingBar")) then
				BFCB:Toggle(false)
			end	
		end
	end
);

if (IsConfigurableAddOn("MailMod")) then
	ModManagement_RegisterCheckBox(
		"BigFootGadget",
		ENABLE_MAIL_MOD,
		nil,
		"EnableMailMod",
		1,
		function (arg)
			if (arg == 1) then
				if (not BigFoot_IsAddOnLoaded("MailMod")) then
					BigFoot_LoadAddOn("MailMod");
				end
				
				if (BigFoot_IsAddOnLoaded("MailMod")) then
					MailMod_Toggle(true);
				end
			else
				if (BigFoot_IsAddOnLoaded("MailMod")) then
					MailMod_Toggle(false);									
				end
			end
		end
	);
end


ModManagement_RegisterCheckBox(
	"BigFootGadget",
	MOD_ARENA_TOOLKIT_ENABLE_FAST_FOCUS_TITLE,
	MOD_ARENA_TOOLKIT_ENABLE_FAST_FOCUS_TOOLTIP,
	"EnableFasyFocus",
	1,
	function (arg)
		if ( arg == 1 ) then
			TargetFrame:SetAttribute("shift-type1", "focus");
			TargetFrame:SetAttribute("shift-type2", "macro");
			TargetFrame:SetAttribute("macrotext", "/CLEARFOCUS");
		else
			TargetFrame:SetAttribute("shift-type1", nil);
			TargetFrame:SetAttribute("shift-type2", nil);
			TargetFrame:SetAttribute("macrotext", nil);
		end
	end
);

	
if (IsConfigurableAddOn("ScreenMark")) then
	ModManagement_RegisterCheckBox(
		"BigFootGadget",
		SCREEN_MARK_PHOTO_MODE,
		nil,
		"ScreenMark_EnablePhotoMode",
		1,
		function (__arg)
			if (__arg == 1) then
				if (not BigFoot_IsAddOnLoaded("ScreenMark")) then
					BigFoot_LoadAddOn("ScreenMark");
				end
				if (BigFoot_IsAddOnLoaded("ScreenMark")) then
					BFScreenMark_EnablePhotoMode = 1; 
				end
			else
				if (BigFoot_IsAddOnLoaded("ScreenMark")) then
					BFScreenMark_EnablePhotoMode = nil;
				end
			end
		end
	);
end
	ModManagement_RegisterCheckBox(
		"BigFootGadget",
		SCREEN_MARK_CINEMATIC_MODE,
		nil,
		"ScreenMark_EnableCinematicMode",
		1,
		function (__arg)
			if (__arg == 1) then
				if (not BigFoot_IsAddOnLoaded("ScreenMark")) then
					BigFoot_LoadAddOn("ScreenMark");
				end
				if (BigFoot_IsAddOnLoaded("ScreenMark")) then
					BFScreenMark_EnableCinematicMode = 1; 
				end
			else
				if (BigFoot_IsAddOnLoaded("ScreenMark")) then
					BFScreenMark_EnableCinematicMode = nil;
				end
			end
		end
	);






